//
//  literal.swift
//  learnSwitf
//
//  Created by Open on 3/25/15.
//  Copyright (c) 2015 open-groupe. All rights reserved.
//

import Foundation


extension NSURL: StringLiteralConvertible {
    public class func
        convertFromStringLiteral(value: String) -> Self
    {
        if let url = self(string: value) {
            return url
        }
        fatalError("Bad URL")
    }
    
    public class func
        convertFromExtendedGraphemeClusterLiteral(value: String) -> Self
    {
        if let url = self(string: value) {
            return url
        }
        fatalError("Bad URL")
    }
    
    public class func
        convertFromUnicodeScalarLiteral(value: String) -> Self
    {
        if let url = self(string: value) {
            return url
        }
        fatalError("Bad URL")
    }
    
  public  class func convertFromStringInterpolation(value: String ) -> Self
  {
    return  self(string: value)!
  }
}
